import { request } from "@/utils";

export const getChannelAPI = () => {
  return request.get("/channels");
};

export const publishArticleAPI = (data) => {
  return request.post("/mp/articles?draft=false", data);
};

export const updateArticleAPI = (id, data) => {
  return request.put(`/mp/articles/${id}?draft=false`, data);
};

export const getArticleListAPI = (params) => {
  return request.get("/mp/articles", {
    params,
  });
};

export const deleteArticleAPI = (id) => {
  return request.delete(`/mp/articles/${id}`);
};

export const getArticleDetailAPI = (id) => {
  return request.get(`/mp/articles/${id}`);
};
